Skip to content

feat(crowdstrike): add tools + validate whatsapp, shopify, trello#4123

Merged
icecrasher321 merged 5 commits intostagingfrom
feat/crowdstrike
Apr 12, 2026
Merged

feat(crowdstrike): add tools + validate whatsapp, shopify, trello#4123
icecrasher321 merged 5 commits intostagingfrom
feat/crowdstrike

Conversation

@icecrasher321
Copy link
Copy Markdown
Collaborator

Summary

Add crowdstrike tools.

Validate old blocks -- whatsapp, shopify, trello so they're in line and work.

Type of Change

  • Bug fix

Testing

Verified using docs.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 12, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Apr 12, 2026 11:39pm

Request Review

@cursor
Copy link
Copy Markdown

cursor bot commented Apr 12, 2026

PR Summary

Medium Risk
Medium risk because it introduces a new external API integration (CrowdStrike) and changes Trello OAuth + WhatsApp webhook authentication/normalization, which can break auth or webhook ingestion if misconfigured.

Overview
Adds CrowdStrike Identity Protection as a first-class integration: new docs page, icons/mappings, landing-page integration metadata, a new /api/tools/crowdstrike/query route (with Zod validation + response normalization), and three new tools (crowdstrike_query_sensors, crowdstrike_get_sensor_details, crowdstrike_get_sensor_aggregates) wired into the tool registry and a new CrowdStrikeBlock.

Hardens and aligns existing integrations. Trello auth/storage/routes and block params are tightened (canonical scopes, callback handling, stricter request parsing/validation, richer inputs like labelIds/paging, and safer board parsing). Shopify block + tools are updated for list pagination (first), order cancellation semantics (restock required + refundMethod), stricter trimming/validation, and updated GraphQL mutations/typing. WhatsApp webhook handling now verifies x-hub-signature-256, generates idempotency keys for batched payloads, and flattens message/status batches into richer trigger outputs; the send block adds previewUrl and exposes additional response fields.

Reviewed by Cursor Bugbot for commit 7aa14ad. Configure here.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Apr 12, 2026

Greptile Summary

This PR adds three CrowdStrike Identity Protection tools (query sensors, get sensor details, get sensor aggregates) along with the corresponding block and docs, and fixes/validates the WhatsApp, Shopify, and Trello integrations. The CrowdStrike route correctly implements the two-step query-then-entities fetch pattern, the WhatsApp webhook provider gains HMAC signature verification and a richer formatInput, and the Shopify block gets cancel-order options and consistent boolean/number parsing using the new parseOptionalBooleanInput/parseOptionalNumberInput utilities in blocks/utils.ts.

Confidence Score: 5/5

Safe to merge — all previously flagged P1 concerns are addressed and the only remaining finding is a P2 style cleanup.

CrowdStrike tools are correctly scoped to identity-protection endpoints and all operations are covered by tests. The WhatsApp, Shopify, and Trello fixes are solid. The single remaining comment is about a redundant payload variable that has no correctness impact.

No files require special attention.

Important Files Changed

Filename Overview
apps/sim/app/api/tools/crowdstrike/query/route.ts New CrowdStrike Identity Protection API route; correctly uses a two-step query-then-entities fetch for sensor search, and directly calls the entities endpoint for get-details and aggregates
apps/sim/blocks/blocks/crowdstrike.ts New CrowdStrike block with three operations; uses parseOptionalNumberInput/parseOptionalJsonInput with correct validation options for limit/offset/aggregateQuery fields
apps/sim/lib/webhooks/providers/whatsapp.ts Major WhatsApp webhook refactor: adds HMAC signature verification (verifyAuth), idempotency key extraction, and richer formatInput covering messages, statuses, and contacts; one redundant payload variable
apps/sim/blocks/blocks/shopify.ts Adds cancel-order options (restock, notifyCustomer, refundMethod), pagination (first), and boolean dropdown helpers using parseOptionalBooleanInput; clean implementation
apps/sim/blocks/blocks/trello.ts New Trello block with six operations; uses canonical param IDs for board selector, thorough input validation per-operation, and consistent parseOptionalBooleanInput/Number usage
apps/sim/app/api/auth/trello/store/route.ts Validates Trello user response more strictly (id type check), removes unused email field from validation URL, and dynamically reads scopes from the canonical provider config
apps/sim/tools/whatsapp/send_message.ts Upgrades to Graph API v25.0, adds previewUrl support, improves error extraction from response body, and adds strict messageId validation on success
apps/sim/blocks/utils.ts Adds three well-tested utility parsers (parseOptionalJsonInput, parseOptionalNumberInput, parseOptionalBooleanInput) with clear validation semantics and test coverage
apps/sim/app/api/tools/crowdstrike/query/route.test.ts Comprehensive tests covering two-step sensor query, direct sensor detail fetch, aggregate normalization, auth failure, and Zod validation errors using vi.stubGlobal for fetch

Sequence Diagram

sequenceDiagram
    participant UI as Sim Block UI
    participant Route as /api/tools/crowdstrike/query
    participant CS as CrowdStrike API

    UI->>Route: POST {operation, clientId, clientSecret, cloud, filter?, limit?, offset?}
    Route->>CS: POST /oauth2/token (client_credentials)
    CS-->>Route: access_token

    alt crowdstrike_query_sensors
        Route->>CS: GET /identity-protection/queries/devices/v1
        CS-->>Route: {resources: [id1, id2, ...]}
        Route->>CS: POST /identity-protection/entities/devices/GET/v1 {ids}
        CS-->>Route: {resources: [{device objects}]}
        Route-->>UI: {sensors, count, pagination}
    else crowdstrike_get_sensor_details
        Route->>CS: POST /identity-protection/entities/devices/GET/v1 {ids}
        CS-->>Route: {resources: [{device objects}]}
        Route-->>UI: {sensors, count}
    else crowdstrike_get_sensor_aggregates
        Route->>CS: POST /identity-protection/aggregates/devices/GET/v1 {aggregateQuery}
        CS-->>Route: {resources: [{buckets,...}]}
        Route-->>UI: {aggregates, count}
    end
Loading

Reviews (3): Last reviewed commit: "fix build" | Re-trigger Greptile

@icecrasher321
Copy link
Copy Markdown
Collaborator Author

@greptile

@icecrasher321
Copy link
Copy Markdown
Collaborator Author

bugbot run

@icecrasher321
Copy link
Copy Markdown
Collaborator Author

@greptile

@icecrasher321
Copy link
Copy Markdown
Collaborator Author

bugbot run

@icecrasher321
Copy link
Copy Markdown
Collaborator Author

bugbot run

@icecrasher321
Copy link
Copy Markdown
Collaborator Author

@greptile

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 7aa14ad. Configure here.

mutation fulfillmentCreateV2($fulfillment: FulfillmentV2Input!) {
fulfillmentCreateV2(fulfillment: $fulfillment) {
mutation fulfillmentCreate($fulfillment: FulfillmentInput!) {
fulfillmentCreate(fulfillment: $fulfillment) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fulfillment mutation name mismatches Shopify API version

Medium Severity

The GraphQL mutation was renamed from fulfillmentCreateV2 with FulfillmentV2Input to fulfillmentCreate with FulfillmentInput, and the response parsing changed from data.data?.fulfillmentCreateV2 to data.data?.fulfillmentCreate. However, the API URL still targets version 2024-10. The fulfillmentCreateV2fulfillmentCreate rename was introduced in a later API version. If the 2024-10 API doesn't recognize fulfillmentCreate/FulfillmentInput, fulfillment creation will fail with a GraphQL error.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 7aa14ad. Configure here.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

supported

@icecrasher321 icecrasher321 merged commit cd3e24b into staging Apr 12, 2026
12 checks passed
@waleedlatif1 waleedlatif1 deleted the feat/crowdstrike branch April 13, 2026 05:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant